package com.gmlive.common.upload.plugin;

import com.taobao.api.TaobaoObject;

import org.gradle.api.Project;

/**
 * @作者: 姜志敏
 * @日期: 2020-01-04
 */
public class ModuleExtension extends TaobaoObject {

    public String groupId;

    public String module;

    public String version;

    public ModuleExtension() {
    }

    public ModuleExtension(String groupId, String module, String version) {
        this.groupId = groupId;
        this.module = module;
        this.version = version;
    }

    public static ModuleExtension getConfig(Project project) {
        ModuleExtension extension = project.getExtensions().findByType(ModuleExtension.class);
        if (extension == null) {
            extension = new ModuleExtension();
        }
        return extension;
    }

    @Override
    public String toString() {
        return "ModuleExtension{" +
                "groupId='" + groupId + '\'' +
                ", module='" + module + '\'' +
                ", version='" + version + '\'' +
                "}";
    }
}
